<template>
  <div class="recommend">
    <div class="title">热销推荐</div>
    <ul>
      <li class="item border-bottom" v-for="item in recommendList" :key="item.id">
        <div class="img-wrapper">
          <img :src="item.imgUrl" alt="" class="item-img">
        </div>
        <div class="info">
          <div class="item-title">{{item.title}}</div>
          <div class="item-desc">{{item.desc}}</div>
          <div class="item-price">
            <div class="price">
              <i>￥</i>99
            </div>
            <button class="item-btn" @click.prevent='goDetail()'>查看详情</button>
          </div>
        </div>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'Recommend',
  props: {
    recommendList: Array
  },
  methods: {
    goDetail () {
      this.$router.push('/detail')
    }
  }
}
</script>

<style lang="stylus" scoped>
.recommend
  .title
    font-size .4rem
    line-height .8rem
    background #eee
    text-indent .2rem
  ul
    background #fff
    .item
      overflow hidden
      display flex
      height 1.9rem
      margin-bottom 0.1rem
      .item-img
        width 1.7rem
        height 1.7rem
        padding .1rem
      .info
        font-size .28rem
        width 100%
        .item-title
          padding-top .1rem
          box-sizing border-box
          font-size .36rem
          font-style bold
        .item-desc
          margin-top .2rem  
          color #ccc
        .item-price
          width 100%
          margin-top .3rem
          font-size .4rem
          color #ff8300  
          display flex
          justify-content space-between
          i 
            font-size .2rem
            font-style normal
          .item-btn
            width 1.4rem
            height 0.5rem
            background #ff8300
            border none
            border-radius .1rem
            font-size .20rem
            color #fff
            margin-right 0.2rem
            line-height .5rem
            text-align center
        
</style>